{	Problem: http://codeforces.ru/problemset/problem/44/B
	Verdict: Accepted
}
var 
    i,j,a,b,c,n,kk,ans:longint;

begin
read(n,a,b,c);
n:=n*2;
ans:=0;
for i:=0 to b do
    for j:=0 to c do begin
        kk:=n-2*i-4*j;
        if (kk>=0) and (kk<=a) then inc(ans);
    end;
write(ans);
end.